package cn.edu.ustc.xrovers.action;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import cn.edu.ustc.xrovers.serviceImpl.LoginServiceImpl;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 用户登陆Action
 * @author paddy
 *
 */
public class LoginAction extends ActionSupport {

	private String username;
	private String password;
	private String type;
	private LoginServiceImpl login;
	
	/**
	 * 查询用户
	 * 调用业务层方法
	 */
	@Override
	public String execute() throws Exception {
		HttpSession session=ServletActionContext.getRequest().getSession();
		String flag=login.findUser(session,username, password, type);
		return flag;
	}
	
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public void setLogin(LoginServiceImpl login) {
		this.login = login;
	}
	public LoginServiceImpl getLogin() {
		return login;
	}
}
